import { ColumnsType } from "@/components";

/**
 * Table 字段对应 Label
 */
export enum TableLabel {
    Id = "ID",
    OrderId = "订单ID",
    State = "订单状态",
    ShopCode = "店铺编码",
    ShopName = "门店名称",
    TotalPrice = "订单总价格",
    OrderType = "订单类型",
    NumberOfDishes = "菜式数量",
    OperatedBy = "操作者",
    CreatedAt = "创建时间",
    UpdatedAt = "更新时间",
    Range = "创建时间范围",
}

export const columns: ColumnsType[] = [
    {
        minWidth: 100,
        label: TableLabel.Id,
        prop: "Id"
    },
    {
        minWidth: 150,
        label: TableLabel.OrderId,
        prop: "OrderId"
    },
    {
        minWidth: 120,
        label: TableLabel.OrderType,
        prop: "OrderType",
        Slots: {
            default: "OrderType"
        }
    },
    {
        minWidth: 150,
        label: TableLabel.State,
        prop: "State",
        Slots: {
            default: "State"
        }
    },
    {
        minWidth: 120,
        label: TableLabel.TotalPrice,
        prop: "TotalPrice"
    },
    {
        minWidth: 120,
        label: TableLabel.ShopCode,
        prop: "ShopCode"
    },
    {
        minWidth: 120,
        label: TableLabel.ShopName,
        prop: "ShopName"
    },
    {
        minWidth: 120,
        label: TableLabel.NumberOfDishes,
        prop: "NumberOfDishes"
    },
    {
        minWidth: 120,
        label: TableLabel.OperatedBy,
        prop: "OperatedBy"
    },
    {
        width: 180,
        DateFormat: true,
        sortable: true,
        label: TableLabel.CreatedAt,
        prop: "CreatedAt"
    },
    {
        width: 180,
        DateFormat: true,
        sortable: true,
        label: TableLabel.UpdatedAt,
        prop: "UpdatedAt"
    },
]